﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.IO;
using System.Web;
using System.Web.Mvc;

namespace Tasks.Common
{

    /// <summary>
    /// 关闭窗口
    /// </summary>
    public class CloseResult : ActionResult
    {
        public CloseResult()
        {
           
        }

        public override void ExecuteResult(ControllerContext context)
        {
            string script = " <script type=\"text/javascript\"> parent.closeCurrentTab();    </script>";
            context.HttpContext.Response.Output.Write(script);
        }
    }

    /// <summary>
    /// 关闭窗口
    /// </summary>
    public class CloseDialogResult : ActionResult
    {
        public CloseDialogResult()
        {

        }

        public override void ExecuteResult(ControllerContext context)
        {
            string script = @"
<script type=""text/javascript"">  
var result = { ""dialogresult"": ""ok"", ""data"": """" };
parent.closeModalDialog(result); //调用主窗口
</script>
";
            context.HttpContext.Response.Output.Write(script);
        }
    }

    /// <summary>
    /// 关闭窗口
    /// </summary>
    public class CloseWindowResult : ActionResult
    {
        public CloseWindowResult()
        {

        }

        public override void ExecuteResult(ControllerContext context)
        {
            string script = @"
<script type=""text/javascript"">  
var result = { ""dialogresult"": ""ok"", ""data"": """" };
parent.closeTabDialog(result); //调用主窗口
</script>
";
            context.HttpContext.Response.Output.Write(script);
        }
    }
}
